package cn.dgut.testEvent;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

/**
 * 定义一个切面
 */

@Aspect
@Component("dAspect")
@EnableAspectJAutoProxy
public class DAspect {

    @Before("execution(* cn.dgut.testEvent.BlackListNotifier.processEvent(..))")
    public void beforeAdvisor(){
        System.out.println("已监听到事件，开始处理");
    }
    @After("execution(* cn.dgut.testEvent.BlackListNotifier.processEvent(..))")
    public void afterAdvisor(){
        System.out.println("事件处理完成，同步回调发布方法");
    }

}
